package com.example.rabbitmqconsumer.direct;

import javafx.util.Pair;

public enum People {


    MAN("M", "MAN"),
    WOMAN("F", "WOMAN");

    String gender;
    String desc;

    People(String gender, String desc) {
        this.gender = gender;
        this.desc = desc;
    }


    public String getGender() {
        return gender;
    }

    public String getDesc() {
        return desc;
    }


    People ofGender(String gender) {

        for (People people : values()) {
            if (people.getGender().equals(gender)) {
                return people;
            }
        }
        throw new RuntimeException("没有查询到相应的枚举类");

    }

    String getDescByGender(String gender) {

        for (People people : values()) {
            if (people.getGender().equals(gender)) {
                return people.getDesc();
            }
        }
        throw new RuntimeException("没有查询到相应的枚举类");

    }


    public static void main(String[] args) {
        Pair<Integer, Integer> pair = new Pair(1, 21);
        System.out.println(pair.getKey());
        System.out.println(pair.getValue());

    }


}
